package de.backtomedieval.units;

import de.backtomedieval.R;
import de.backtomedieval.game.Costs;
import de.backtomedieval.main.Game;
import de.backtomedieval.research.Technology;

public class ShortSwordsman extends AbstractUnit {
	//*******************************************
	private static final int _healthpoints = 100;
	private static final int _attackMultiple = 1;
	private static final int _attack = 15;
	private static final int _defense = 5;
	private static final int _attackquality = 50;
	private static final int[] _attackRounds = {6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
	private static Costs costSetting = null;	
	private static final int _buildPoints = 100;	
	//*******************************************
	public static int getBaseAttack() {
		return _attack;
	}
	
	public ShortSwordsman(Technology technology) {
		super(_healthpoints, _attack, _defense, _attackquality, _attackMultiple, _attackRounds, _buildPoints);
		if (technology != null) this.setAttack(_attack + technology.getShortSwordsmanAttackBonus());
		if (technology != null) this.setDefense(_defense + technology.getShortSwordsmanDefenseBonus());
		if (costSetting == null){
			costSetting = new Costs();
			costSetting.setIronCost(20);
			costSetting.setGoldCost(10);
			}
		this.setCosts(costSetting);
	}


	@Override
	public String getName(int count) {
		if (count==1) return Game.getString(R.string.unit_shortswordman);
		return Game.getString(R.string.unit_shortswordman_pl);
	}
	
	@Override
	public Integer getImage() {
		return R.drawable.short_s;
	}
	
	@Override
	public int getBuildIn() {
		return AbstractUnit.BUILD_IN_BARRACKS;
	}



	public static int getBaseDefense() {
		return _defense;
	}
}
